<template>
  <j-modal
    title='考核明细'
    :visible='visible'
    ok-text=''
    :footer="null"
    :ok-button-props="{ props: { disabled: true } }"
    :fullscreen='true'
    @close="close"
  >
    <a-card :bordered='false'>
      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSource'
        :pagination='false'
        :loading='loading'
      >
        <span slot='actionName'>
          <a-button size='small' @click='handleAdd(queryParam)' type='primary' icon='plus'>新增</a-button>
        </span>
        <span slot='action' slot-scope='text, record'>
<!--              <a>查看</a>-->
          <!--              <a-divider type='vertical'/>-->
              <a @click="handleEdit(record,'人员编辑')">编辑</a>
              <a-divider type='vertical'/>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                 <a>删除</a>
              </a-popconfirm>
             </span>
      </a-table>
      <!-- table区域-end -->
      <editProject ref="modalForm" @ok="modalFormOk"></editProject>
    </a-card>
  </j-modal>
</template>
<script>
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import {httpAction, getAction, postAction, deleteAction} from '@/api/manage'
  import columns from './typeListModelColumns'
  import editProject from './editProject'

  export default {
    name: 'projectListModal',
    mixins: [JeecgListMixin],
    components: {
      editProject
    },
    data() {
      return {
        // 表头
        columns: columns(this),
        queryParam: {},
        url: {
          list: '/performcheck/checkTypeInfo/queryTypeList',
          delete: '/performcheck/checkTypeInfo/deleteType',
        },
        visible: false,
        dataSource: [],
      }
    },
    computed: {},
    methods: {
      handleAdd: function (queryParam) {
        this.$refs.modalForm.add(queryParam);
      },
      edit(record) {
        this.dataSource = []
        this.queryParam.projectId = Object.assign({}, record).id
        this.loadData()
        this.visible = true
      },
      close() {
        this.visible = false
        this.$emit('ok')
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>